{layout name="admin/layout" /}

<div class="col-xs-12">
    <div class="page-header">
        <h1>{:v('headtitle')}</h1>
    </div>
    {if condition="has_menu($menu,'User/add')"}
    <button class="btn btn-success store" data-url="{:url('add')}" style="margin-bottom: 15px">新增用户</button>
    {/if}
    <div class="table-responsive">
        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
            <thead>
            <tr>
                <th class="center">
                    <label>
                        <input type="checkbox" class="ace"/>
                        <span class="lbl"></span>
                    </label>
                </th>
                <th>id</th>
                <th>登陆账号</th>
                <th>昵称</th>
                <th>微信号openid</th>
                <th>用户类型</th>
                <th>不限制积分</th>
                <th>限制积分</th>
                <th>限制积分下一次兑换时间</th>
                <th>添加时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </tr>
            </thead>

            <tbody>
            {volist name='list' id='v'}
            <tr>
                <td class="center">
                    <label>
                        <input type="checkbox" class="ace"/>
                        <span class="lbl"></span>
                    </label>
                </td>
                <td>{$v.id}</td>
                <td>{$v.u_username}</td>
                <td>{$v.u_nickname}</td>
                <td>{$v.u_openid}</td>
                <td>{eq name='v.u_type' value='1'}普通用户{else /}经销商{/eq}</td>
                <td>{$v.tz_integral}</td>
                <td>{$v.mf_integral}</td>
                <td>{eq name='v.exchange_time' value=''}从未兑换{else /}{$v.exchange_time|date='Y-m-d H:i:s',###}{/eq}</td>
                <td>{$v.create_time}</td>
                <td>{$v.update_time}</td>
                <td>
                    <div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
                        {eq name='v.u_type' value='1'}
                        {if condition="has_menu($menu,'User/distributor')"}
                        <button class="btn btn-xs btn-primary" id="distributor" data-url="{:url('User/distributor',array('id'=>$v['id']))}">成为经销商</button>
                        {/if}
                        {/eq}
                    </div>
                </td>
            </tr>
            {/volist}
            </tbody>
        </table>
    </div><!-- /.table-responsive -->
</div><!-- /span -->